package com.ingesup.caribou.client;


import java.io.IOException;
import java.net.UnknownHostException;

public class TestSocket
{
	public static void main(String[] args) throws UnknownHostException, IOException
	{
		SocketClient socktest = new SocketClient("127.0.0.1", 20006);
		
		try
		{
			socktest.StartConnection();
			String rep= "";
			while(rep !="STOP")
			{
				rep = socktest.ExchangeData("stop");
			}
		}
		
		catch(UnknownHostException eUHE)
		{
			System.out.println("Connection failed, thrown Exception : UnknownHostException");
		}
		
		catch(IOException eIOE)
		{
			System.out.println("Connection failed, thrown Exception : IOException");
		}
		
		finally
		{
			socktest.CloseConnection();
		}
	}
}
